package com.hyz.controller;

import com.hyz.pojo.ResponseResult;
import com.hyz.pojo.assetSecondment.AssetSecondmentRequest;
import com.hyz.pojo.assetSecondment.AssetSecondmentResponse;
import com.hyz.service.ApproveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author HGD
 * @date 2022/10/5 0:43
 */
@Api("部门审批人员")
@RestController
@RequestMapping("/approve")
public class ApproveController {
    @Autowired
    private ApproveService service;

    @ApiOperation("获取借用申请")
    @ApiResponse(code = 200, message = "成功", response = ResponseResult.class)
    @PostMapping("/apGetAssetSecondments")
    public ResponseResult<List<AssetSecondmentResponse>> apGetAssetSecondments() {
        return service.apGetAssetSecondments();
    }

    @ApiOperation("审批借用申请")
    @ApiParam("申请id和判断结果")
    @ApiResponse(code = 200, message = "成功", response = ResponseResult.class)
    @PostMapping("/updateAssetSecondment")
    public ResponseResult<List<AssetSecondmentResponse>> apUpdateAssetSecondment(@RequestBody AssetSecondmentRequest request) {
        return service.apUpdateAssetSecondment(request);
    }
}
